<template>
  <div class="snackbar">
    <van-nav-bar
      :fixed="true"
      :title="title == null ? this.$route.name:title"
      left-text="返回"
      :right-text="meunLabel==null ? '':meunLabel"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
  </div>
</template>

<script>
  import './index.scss'

  export default {
    name: "Snackbar",
    props: {
      title: {
        type: String,
        default: null
      },
      meunLabel: {
        type: String,
        default: null
      }
    },
    methods: {
      onClickRight() {
        this.$emit('onMeunClick')
      },
      onClickLeft() {
        this.$router.back();
        return false;
      },
    }
  }
</script>
